class LayerServer<Keys extends string[], T extends string|number|symbol = Keys extends { [key: number]: infer T } ? T : never> {
    baseUrl: string
    keys: Keys
    urls: Record<T,string>
    constructor(mapServer: string, mapKeys: Keys) {
        this.baseUrl = mapServer
        this.keys = mapKeys
        this.urls = this.keys.reduce(
            (a, item, index) => ((a[item] = this.baseUrl + `/${index}`), a),
            <Record<T, string>>{}
        )
    }
}

const layerServer = new LayerServer<['first', 'second']>('http://test.cn', ['first', 'second'])

// 这里希望  layerServer.urls. 之后编辑器能给 'first'和'second'的提示，如何实现？
let first = layerServer.urls.first;
export default {
    LayerServer
}
